<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="approval.ApprovalDTO"%>
<%@page import="java.util.List"%>
<%@page import="approval.ApprovalDAO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 모바일 사용자를 위해 viewport 추가-->
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<!--모바일 기기에서 확대/축소 불가<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
콘텐츠 중앙으로 가져오기<div class="container">...</div>-->
<title></title>
<style type="text/css">
th {
	background-color: #e5e5e5;
}
</style>

<!-- 계산기 -->

<link rel="stylesheet" type="text/css"
	href="http://loan.ooi.kr/css/bootstrap.min.css">
<link rel="stylesheet"
	href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<!-- <link rel="stylesheet" href="http://loan.ooi.kr/css/common.css"> -->

<!--[if lte IE 8]>
<script src="http://loan.ooi.kr/js/html5.js"></script>
<![endif]-->
<script>
	// 자바스크립트에서 사용하는 전역변수 선언
	var g5_url = "http://loan.ooi.kr";
	var g5_bbs_url = "http://loan.ooi.kr/bbs";
	var g5_is_member = "";
	var g5_is_admin = "";
	var g5_bo_table = "";
	var g5_sca = "";
	var g5_editor = "";
	var g5_cookie_domain = "";	
</script>
<link>
<script src="http://loan.ooi.kr/js/jquery-1.8.3.min.js"></script>
<script
	src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>
<script
	src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="http://loan.ooi.kr/js/jquery.ui.touch-punch.min.js"></script>
<script src="http://loan.ooi.kr/js/cal.js"></script>
<script src="http://loan.ooi.kr/js/common.js"></script>
<script src="http://loan.ooi.kr/js/wrest.js"></script>
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
	(function(i, s, o, g, r, a, m) {
		i['GoogleAnalyticsObject'] = r;
		i[r] = i[r] || function() {
			(i[r].q = i[r].q || []).push(arguments)
		}, i[r].l = 1 * new Date();
		a = s.createElement(o), m = s.getElementsByTagName(o)[0];
		a.async = 1;
		a.src = g;
		m.parentNode.insertBefore(a, m)
	})(window, document, 'script', '//www.google-analytics.com/analytics.js',
			'ga');
	ga('create', 'UA-52509530-1', 'auto');
	ga('send', 'pageview');
</script>
<script src="${pageContext.request.contextPath}/homepage/product/calcuator2.js"></script>

<!-- jQeury -->
<script src="//code.jquery.com/jquery.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
<!-- bootstrap -->
<link rel="stylesheet"
	href="//netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/css/bootstrap.min.css">
<script
	src="//netdna.bootstrapcdn.com/bootstrap/3.0.0-wip/js/bootstrap.min.js"></script>
<!-- DateTimePicker -->
<link rel="stylesheet" type="text/css"
	href="../css/jquery.datetimepicker.css" />
<script src="../js/jquery.js"></script>
<script src="../js/jquery.datetimepicker.js"></script>
<script>
	var url = "${pageContext.request.contextPath}/intranet/approval/";

	params = "";

	function closeViewWindow() {
		//alert("창닫힌당");
		window.close();
	}

	/* 결재 요청 버튼 눌렀을 때 */
	function requestApproval(ct_ing) {
		var sessionID = $("#sessionID").val();
		//alert(sessionID);
		
		url += "ap_insert.jsp";

		var ct_no = $('#ct_no').val(); /* 계약번호 */
		var sa_no = $('#sa_no').val(); /* 사원번호 */
		var sa_nm = $('#sa_nm').val(); /* 사원명 */
		var ct_ing = $('#ct_ing').val(); /* 계약진행상태코드 */
		var ct_ing_nm = $('#ct_ing_nm').val(); /* 계약진행상태코드명 */
		var ap_content = $('#ap_content').val(); /* 요청내용 */
		var ap_req_time = $('#datetimepicker1').val(); /* 신청일자 */
		var ap_req_sa = $('#rg_pp').val(); /* 상신자(등록자)사번 */
		var rg_pp_nm = $('#rg_pp_nm').val(); /* 상신자(등록자)명 */
		
		//alert(ct_ing);
		if(sessionID != ap_req_sa || ct_ing == '02'){
			alert("해당 건은 결재를 요청할 수 없습니다. 관리자에게 문의바랍니다.");
			return;			
		}
		
		params  = "ct_no=" + ct_no;
		params += "&sa_no=" + sa_no;
		params += "&sa_nm=" + sa_nm;
		params += "&ct_ing=" + ct_ing;
		params += "&ct_ing_nm=" + ct_ing_nm;
		params += "&ap_content=" + ap_content;
		params += "&ap_req_time=" + ap_req_time;
		params += "&ap_req_sa=" + ap_req_sa;
		params += "&rg_pp_nm=" + rg_pp_nm;
		//alert(params);

		$.ajax({
			type : 'POST',
			url : url,
			data : params,
			success : function() {
				alert("결재가 요청되었습니다.");
				/* window.opener.parent.location.reload(); */
				window.opener.location.href="${pageContext.request.contextPath}/Cont/ContView.clamp?ct_no="+ct_no;
				window.close();
			},
			error : function(request, status, error) {
				alert("code:" + request.status + "\n" + "message:"
						+ request.responseText + "\n" + "error:" + error);
			}
		});
	}

	/* | 승인 | 부결 | 반려 | 버튼 눌렀을 때 */
	function ap_result(nanum) {
		
		var ap_no = $('#ap_no').val(); /* 결재번호 */
		var ct_no = $('#ct_no').val(); /* 계약번호 */
		var sa_no = $('#sa_no').val(); /* 사원번호 */
		var ct_ing = $('#ct_ing').val(); /* 계약진행상태코드 */
		var ap_content = $('#ap_content').val(); /* 요청내용 */
		
		var pd_prd = $('#pd_prd').val();
		var cs_loan = $('#cs_loan').val();
		var pd_rate = $('#pd_pback ').val();
		var pd_pback = $('#pd_pback ').val();
		var SA_NM=$('#SA_NM').val();

		if(ct_ing != '02'){
			alert("결재요청 후 진행가능합니다.");
			return;
		}
		url += "ap_update.jsp";

		params  = "ap_no=" + ap_no;
		params += "&ct_no=" + ct_no;
		params += "&ct_ing=" + ct_ing;
		params += "&sa_no=" + sa_no;
		params += "&nanum=" + nanum;
		params += "&ap_content=" + ap_content;

		//alert(params);
		//alert(url);
		
		if (nanum == '03') { // 승인
			params += "&pd_prd="+pd_prd;
			params += "&cs_loan="+cs_loan;
			params += "&pd_rate="+pd_rate;
			params += "&pd_pback="+pd_pback;
			params += "&SA_NM="+SA_NM;
			params += $("#frm").serialize();
			var flag = confirm("결재를 승인하시겠습니까?");
			//alert(params);
			if (flag) {
				$.ajax({
					type : 'POST',
					url : url,
					data : params,
					success : function() {
						alert("승인되었습니다.");
						var okUrl = "${pageContext.request.contextPath}/Cont/ContView.clamp";
						okUrl += "?ct_no="+ct_no;
/* 						okUrl += "&pd_prd="+pd_prd;
						okUrl += "&cs_loan="+cs_loan;
						okUrl += "&pd_rate="+pd_rate;
						okUrl += "&pd_pback="+pd_pback; */
						window.opener.location.href=okUrl;
						window.close();
					},
					error : function(request, status, error) {
						alert("code:" + request.status + "\n" + "message:"
								+ request.responseText + "\n" + "error:"
								+ error);
					}
				});
			}else{
				alert("취소되었습니다.");
			}
		} else if (nanum == '04') { // 부결
			var flag = confirm("결재를 부결하시겠습니까?");
			if (flag) {
				$.ajax({
					type : 'POST',
					url : url,
					data : params,
					success : function() {
						alert("부결되었습니다.");
						window.opener.location.href="${pageContext.request.contextPath}/Cont/ContView.clamp?ct_no="+ct_no;
						window.close();
					},
					error : function(request, status, error) {
						alert("code:" + request.status + "\n" + "message:"
								+ request.responseText + "\n" + "error:"
								+ error);
					}
				});
			}else{
				alert("취소되었습니다.");
			}
		} else if (nanum == '05') { // 반려
			var flag = confirm("결재를 반려하시겠습니까?");
			if (flag) {
				$.ajax({
					type : 'POST',
					url : url,
					data : params,
					success : function() { 
						alert("반려되었습니다.");
						window.opener.location.href="${pageContext.request.contextPath}/Cont/ContView.clamp?ct_no="+ct_no;
						window.close();
					},
					error : function(request, status, error) {
						alert("code:" + request.status + "\n" + "message:"
								+ request.responseText + "\n" + "error:"
								+ error);
					}
				});
			}else{
				alert("취소되었습니다.");
			}
		}
	}
	// 스케줄
		function schedule() {

		var CS_REM = $('#CS_REM').val();
		var PD_PRD = $('#PD_PRD').val();
		var PD_RATE = $('#PD_RATE').val();
		var PD_PBACK = $('#PD_PBACK').val();
		var CT_NO = $('#CT_NO').val();
		var SA_NO = $('#SA_NO').val();
				
		var params = "CS_REM=" + CS_REM;
		params += "&PD_PRD=" +PD_PRD;
		params += "&PD_RATE=" +PD_RATE;
		params += "&PD_PBACK=" +PD_PBACK;
		params += "&CT_NO=" +CT_NO;
		params += "&SA_NO=" +SA_NO;
		$.ajax({
					url : '${pageContext.request.contextPath}/homepage/product/calculator2.jsp',
					type : 'POST',
					data : params,
					success : function(html) {
						$('#jax').html(html);
						initialize();
					},
					error : function(request, status, error) {
						alert("실패");
					}
				});
		
	}
	//팝업창 중복 처리 해결을 위해
	function closewin(){
	    // opener는 원래창의 참조
	    if ( opener != null ) { opener._childwin = null; self.close(); }
	}

</script>
</head>
<body onbeforeunload="closewin()" onunload="closewin()">
	<%
		String gubun = request.getParameter("gubun");

		/** 결재원장에서 팝업을 호출했을 때 (gubun=ap_list) 시작 **/
		if ("ap_list".equals(gubun)) {
			System.out.println("결재원장에서 팝업을 호출했을 때 (gubun=ap_list)");
	%>

	<jsp:useBean id="dto" class="approval.ApprovalDTO" />
	<jsp:setProperty property="*" name="dto" />
	<%
		ApprovalDAO dao = new ApprovalDAO();
			dao.setDto(dto);

			ApprovalDTO popup = dao.ap_popup(dto.getAp_no());
			/* List<ApprovalDTO> list = dao.list();
			 ApprovalDTO gun = list.get(0); */

			/* System.out.println("ct_no : "+ popup.getCt_no());
			 System.out.println("sa_no : "+ popup.getSa_no());
			 System.out.println("sa_no_nm : "+ popup.getSa_no_nm());
			 System.out.println("ct_ing : "+ popup.getCt_ing());
			 System.out.println("rg_pp : "+ popup.getRg_pp()); */

			/* System.out.println("ap_content : "+gun.getAp_content()); */

			/* 세션값 저장 */
			String mid = (String) session.getAttribute("mid");
	%>
	<!-- 제목 -->
	<h2 style="margin-left: 10px;">
		결재<small>Approval</small>
	</h2>
	<hr />
	<!-- 버튼그룹 영역 -->
	<!-- 	<div align="right" style="margin-right: 10px;">
		<div class="btn-group">
			<button type="button" class="btn btn-primary" disabled="disabled">결재요청</button>
		</div>
		<div class="btn-group">
		<button type="button" class="btn btn-success" disabled="disabled"
				style="width: 100px;">승인</button>
			<button type="button" class="btn btn-warning" disabled="disabled">부결</button>
			<button type="button" class="btn btn-danger" disabled="disabled">반려</button>
		</div>
	</div> -->


	<!-- 테이블 영역 -->
	<table class="table"
		style="width: 600px; margin-top: 20px; margin-left: 10px; margin-right: 10px;">
		<thead>
			<tr>
				<th>결재명</th>
				<td><%=popup.getSa_no_nm()%> 님의 대출 결재요청</td>
			</tr>
			<tr>
				<th>계약번호</th>
				<td><%=popup.getCt_no()%></td>
			</tr>
			<tr>
				<th>사원명</th>
				<td><%=popup.getSa_no_nm()%></td>
			<tr>
				<th>계약진행상태</th>
				<td><%=popup.getCt_ing_nm()%></td>
			</tr>
			<tr>
				<th style="vertical-align: middle;">요청내용</th>
				<td style="vertical-align: middle;"><textarea  style="resize: none;"
						class="form-control" rows="3" readonly="readonly"><%=popup.getAp_content()%></textarea></td>
			</tr>
			<tr>
				<th>신청일자</th>
				<td><input type="text" id="ap_req_time" class="form-control"
					value="<%=popup.getAp_req_time()%>" readonly="readonly" disabled="disabled"></td>
			</tr>
			<tr>
				<th>상신자</th>
				<td><%=popup.getAp_req_sa_nm()%></td>
			</tr>
			<tr>
				<th>결재권자</th>
				<td><input type="text" class="form-control" readonly="readonly"
					disabled="disabled" value="김환태"></td>
			</tr>
			<!-- <tr>
				<th>등록일</th>
				<td>2014.07.31 09:38</td>
				<th>수정일</th>
				<td>2014.07.31 17:42</td>
			</tr> -->
		</thead>
	</table>






	<%
		// From Mirme 계약 상세보기에서 팝업을 호출했을 때 (gubun!=ap_list 또는 null)
		} else if (!"ap_list".equals(gubun) || gubun == null) {
	%>

	<jsp:useBean id="dto2" class="approval.ApprovalDTO" />
	<jsp:setProperty property="*" name="dto2" />

	<%
			ApprovalDAO dao = new ApprovalDAO();
			dao.setDto(dto2);
			
			System.out.println("ap_nooooo : " + dto2.getAp_no());
			System.out.println("ct_nooooo : " + dto2.getCt_no());
			System.out.println("계약상세에서 팝업을 호출했을 때 (gubun='')");

			
			String ct_ing    = request.getParameter("ct_ing"); /* 계약상태코드 */
			System.out.println("ct_ing : "+ct_ing);
			String ap_no     = "";
			String ct_no     = "";
			String sa_no     = "";
			String sa_no_nm  = "";
			String ct_ing_nm = "";
			String rg_pp     = "";
			String rg_pp_nm    = "";
			String ap_content  = "";
			String pd_prd    = request.getParameter("pd_prd"); /* 대출기간 */   
			String cs_loan   = request.getParameter("cs_loan"); /* 대출신청액 */ 
			String pd_rate   = request.getParameter("pd_rate"); /* 금리 */    
			String pd_pback  = request.getParameter("pd_pback"); /* 상환방법 */ 
			//상담완료상태에서 팝업을 호출할 경우는 계약에서 보내준 데이터로 화면데이터를 구성한다.
			if("01".equals(ct_ing)) {
				//ap_no     = request.getParameter("ap_no") != null ? request.getParameter("ap_no") : ""; /* 결재번호 */                 
				ct_no     = request.getParameter("ct_no"); /* 계약번호 */                                                              
				sa_no     = request.getParameter("sa_no"); /* 사원번호 */                                                              
				sa_no_nm  = request.getParameter("sa_no_nm"); /* 사원명 */                                                            
				ct_ing_nm = request.getParameter("ct_ing_nm"); /* 계약상태코드명 */                                                       
				rg_pp     = request.getParameter("rg_pp"); /* 담당자 */                                                               
				rg_pp_nm  = request.getParameter("rg_pp_nm"); /* 담당자명 */   
				ap_content = sa_no_nm + "님의 대출 결재요청입니다.";
			}
			//결재요청이 한번이라도 이루어진경우는 DB에서 데이터를 읽어온다.
			else {
				ApprovalDTO popup = dao.ap_popup(dto2.getAp_no());	
				ap_no     = popup.getAp_no();                     
				ct_no     = popup.getCt_no();                     
				sa_no     = popup.getSa_no();                     
				sa_no_nm  = popup.getSa_no_nm();                 
				ct_ing_nm = popup.getCt_ing_nm();                    
				rg_pp     = popup.getRg_pp();                    
				rg_pp_nm  = popup.getRg_pp_nm();
				ap_content= popup.getAp_content();
			}
			
			/* From Mirme ======================================================== */
			//String ap_no = request.getParameter("ap_no") != null ? request.getParameter("ap_no") : ""; /* 결재번호 */
			//String ct_no = request.getParameter("ct_no"); /* 계약번호 */
			//String sa_no = request.getParameter("sa_no"); /* 사원번호 */
			//String sa_no_nm = request.getParameter("sa_no_nm"); /* 사원명 */
			//
			//String ct_ing_nm = request.getParameter("ct_ing_nm"); /* 계약상태코드명 */
			//String rg_pp = request.getParameter("rg_pp"); /* 담당자 */
			//String rg_pp_nm = request.getParameter("rg_pp_nm"); /* 담당자명 */
            //
			//String pd_prd = request.getParameter("pd_prd"); /* 대출기간 */
			//String cs_loan = request.getParameter("cs_loan"); /* 대출신청액 */
			//String pd_rate = request.getParameter("pd_rate"); /* 금리 */
			//String pd_pback = request.getParameter("pd_pback"); /* 상환방법 */
			/* =================================================================== */

			/* 오늘날짜출력 */
			Date day = new Date();
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
			String today = sdf.format(day);
			System.out.println("결재번호있니?" + ap_no);
			System.out.println("계약번호왔니?" + ct_no);
	%>

	<!-- 제목 -->
	<h2 style="margin-left: 10px;">
		결재<small>Approval</small>
	</h2>

	<!-- 버튼그룹 영역 -->
	<div align="right" style="margin-right: 10px;">

		<%
			/* 세션값으로 요청자인지 승인자인지 구별 */
				/* session.setAttribute("mid", "1408M001"); */
				String mid = (String) session.getAttribute("mid");
				System.out.println("mid : " + mid);

				if ("1408M001".equals(mid)) { // 결재자 아이디로 로그인했을 시
		%>
		<!-- <div class="btn-group">
			<button type="button" class="btn btn-primary" disabled="disabled">결재요청</button>
		</div> -->
		<div class="btn-group">
			<button type="button" class="btn btn-success" style="width: 100px;"
				onclick="ap_result('03')">승인</button>
			<button type="button" class="btn btn-danger" onclick="ap_result('04')">부결</button>
			<button type="button" class="btn btn-warning" onclick="ap_result('05')">반려</button>
		</div>
		<%
			} else { // 그 외 아이디로 로그인했을 시
		%>
		<div class="btn-group">
			<button type="button" class="btn btn-danger"
				onclick="requestApproval('<%=ct_no%>')">결재요청</button>
		</div>
		<!-- <div class="btn-group">
			<button type="button" class="btn btn-success" disabled="disabled"
				style="width: 100px;">승인</button>
			<button type="button" class="btn btn-danger" disabled="disabled">부결</button>
			<button type="button" class="btn btn-warning" disabled="disabled">반려</button>
		</div> -->
		<%
			}
		%>
		<hr />
	</div>
	<!-- 테이블 영역 -->
	<table class="table"
		style="width: 600px; margin-top: 20px; margin-left: 10px; margin-right: 10px;">
		<thead>
			<tr>
				<th>결재명</th>
				<td><%=sa_no_nm%> 님의 대출 결재요청 <input type="hidden"
					id="sessionID" value="${mid }"> <input type="hidden"
					id="ap_no" value="<%=ap_no%>"></td>
			</tr>
			<tr>
				<th>계약번호</th>
				<td><input type="hidden" id="ct_no" value="<%=ct_no%>"
					readonly="readonly" class=form-control> <input type="text"
					readonly="readonly" class="form-control"
					value="<%=ct_no%>"></td>
			</tr>
			<tr>
				<th>사원명</th>
				<td><input type="hidden" id="sa_nm" readonly="readonly"
					value="<%=sa_no_nm%>" class=form-control> <input
					type="hidden" id="sa_no" value="<%=sa_no%>">
				<input type="text" readonly="readonly" class="form-control" value="<%=sa_no_nm%>">	
				</td>
			<tr>
				<th>계약진행상태</th>
				<td><input type="hidden" id="ct_ing_nm" readonly="readonly"
					value="<%=ct_ing_nm%>" class=form-control> <input
					type="hidden" id="ct_ing" value="<%=ct_ing%>">
				<input type="text" readonly="readonly" class="form-control" value="<%=ct_ing_nm%>">
				</td>
			</tr>
			<tr>
				<th style="vertical-align: middle;">요청내용</th>
				<td style="vertical-align: middle;"><textarea style="resize: none;"
						class="form-control" rows="3" id="ap_content"><%=ap_content%></textarea></td>
			</tr>
			<tr>
				<th>신청일자</th>
				<%
					if ("1408M001".equals(mid)) { // 결재자 아이디로 로그인했을 시
				%>
				<td><input type="text" id="datetimepicker1" class=form-control
					value="<%=today%>" readonly="readonly" disabled="disabled"></td>
				<%
					} else {
				%>
				<td><input type="text" id="datetimepicker1" class=form-control
					value="<%=today%>"></td>
				<%
					}
				%>
			</tr>
			<tr>
				<th>상신자</th>
				<td><input type="hidden" value="<%=rg_pp_nm%>" id="ap_req_sa"
					readonly="readonly" class=form-control> <input
					type="hidden" value="<%=rg_pp%>" id="rg_pp">
				<input type="text" readonly="readonly" class="form-control" value="<%=rg_pp_nm%>">	
				</td>
			</tr>
			<tr>
				<th>결재권자</th>
				<td><input type="text" id="ap_ap_sa" readonly="readonly"
					disabled="disabled" value="김환태" class=form-control></td>
			</tr>
			<!-- <tr>
				<th>등록일</th>
				<td>2014.07.31 09:38</td>
				<th>수정일</th>
				<td>2014.07.31 17:42</td>
			</tr> -->
		</thead>
	</table>
	<input type="hidden" id="pd_prd" value="<%=pd_prd %>">
	<input type="hidden" id="cs_loan" value="<%=cs_loan %>">
	<input type="hidden" id="pd_rate" value="<%=pd_rate %>">
	<input type="hidden" id="pd_pback" value="<%=pd_pback %>">

	<%
		}
	%>

	<!-- dateTimePicker -->
	<script>
		jQuery('#datetimepicker1').datetimepicker(
				{
					lang : 'kr',
					i18n : {
						de : {
							months : [ 'Januar', 'Februar', 'März', 'April',
									'Mai', 'Juni', 'Juli', 'August',
									'September', 'Oktober', 'November',
									'Dezember', ],
							dayOfWeek : [ "So.", "Mo", "Di", "Mi", "Do", "Fr",
									"Sa.", ]
						}
					},
					timepicker : false,
					format : 'Y-m-d'
				});
	</script>


	<!-- 버튼 그룹 -->
	<div style="margin-top: 30px;" align="center">
		<p>
			<button type="button" class="btn btn-default"
				onclick="closeViewWindow()">닫기</button>
		</p>
	</div>
	<% String rem=request.getParameter("cs_loan");
	   String pback=request.getParameter("pd_pback");
	   String sa_no=request.getParameter("sa_no");
	   String ct_no=request.getParameter("ct_no");
	   String prd=request.getParameter("pd_prd");
	   String rate=request.getParameter("pd_rate");
	   String sa_nm =request.getParameter("sa_no_nm");
	%>
	<input type="hidden" value="<%=rem%>" id='CS_REM'>
	<input type="hidden" value="<%=pback %>" id='PD_PBACK'>
	<input type="hidden" value="<%=sa_no%>" id='SA_NO' >
	<input type="hidden" value="<%=ct_no%>" id='CT_NO' >
	<input type="hidden" value="<%=prd %>" id='PD_PRD'>
	<input type="hidden" value="<%=rate%>" id='PD_RATE' >
	<input type="hidden" value="<%=sa_nm %>" id="SA_NM">
	<div id='jax' style="display:none">
	
	</div>
<script type="text/javascript">
 schedule()
 </script>
</body>
</html>